/**
 * 外观数据
 */
package jinyilw.swing.rlaf.theme;

import jinyilw.swing.FontTools;
import jinyilw.swing.icon.LazyScaleIcon;

import javax.swing.Icon;
import java.awt.Color;
import java.awt.Font;

/**
 * @author Jinyi
 */
public class UIData
{

	private static volatile UIData defaultUIData;

	public FrameUI frameUI;
	public DialogUI dialogUI;

	public UIData()
	{
		frameUI = new FrameUI();
		dialogUI = new DialogUI();
	}

	public static UIData getDefaultUIData()
	{
		if (defaultUIData == null)
			synchronized (UIData.class)
			{
				if (defaultUIData == null)
				{
					defaultUIData = new UIData();
				}
			}
		return defaultUIData;
	}

	public static class FrameUI
	{
		public Icon closeIcon, closeIcon1, hideIcon, hideIcon1, maxIcon,
				maxIcon1, maxIcon2, maxIcon3, setIcon;
		public int titleHeight = 22;
		public Font titleFont = FontTools.getFrameTitleFont();
		public Color titleColor = new DoubleColor(Color.YELLOW, Color.CYAN);

		public FrameUI()
		{
			closeIcon = getLazyScaleIcon("ico/close.png");
			closeIcon1 = getLazyScaleIcon("ico/close1.png");
			hideIcon = getLazyScaleIcon("ico/minimize.png");
			hideIcon1 = getLazyScaleIcon("ico/minimize1.png");
			maxIcon = getLazyScaleIcon("ico/maximize2.png");
			maxIcon1 = getLazyScaleIcon("ico/maximize3.png");
			maxIcon2 = getLazyScaleIcon("ico/maximize6.png");
			maxIcon3 = getLazyScaleIcon("ico/maximize7.png");
			setIcon = getLazyScaleIcon("ico/set.png");
		}
	}

	public static class DialogUI
	{
		public Icon closeIcon, closeIcon1;
		public int titleHeight = 20;
		public Font titleFont = FontTools.getDialogTitleFont();
		public Color titleColor = Color.WHITE;
		public DialogUI()
		{
			closeIcon = getLazyScaleIcon("ico/close2.png");
			closeIcon1 = getLazyScaleIcon("ico/close3.png");
		}
	}

	static LazyScaleIcon getLazyScaleIcon(String path)
	{
		return LazyScaleIcon.getIcon(UIData.class, path);
	}
}
